#ifndef NOT_QUERY_H
#define NOT_QUERY_H
#include "Query.h"
#include "Query_base.h"
#include <memory>
using std::shared_ptr; using std::make_shared;
#include <set>
#include <algorithm>

class NotQuery : public Query_base {
    friend Query operator~(const Query &);
    NotQuery(const Query &q): query(q) {}
    string rep() const { return "~" + query.rep();}
    QueryResult eval(const TextQuery&) const override;
    Query query;
};
inline Query operator~(const Query &operand){
    // if(DEBUG) cout << "NotQuery(" << operand.rep() << ") constructed" << endl;
    return shared_ptr<Query_base>(new NotQuery(operand));
}
#endif 